package com.twu.biblioteca.db;

import com.twu.biblioteca.model.User;

import java.util.ArrayList;
import java.util.List;

public class UserStore {
    List<User> users;

    public UserStore() {
        users = new ArrayList<User>();
        users.add(new User("111-1000","user1","user1@mail1.com","9900990000","password1"));
        users.add(new User("111-1001","user2","user2@mail1.com","9900990001","password2"));
        users.add(new User("111-1002","user3","user3@mail1.com","9900990002","password3"));
    }

    public User findUserById(String id){
        for(User user:users){
            if(user.getLibraryNumber().equals(id))
                return user;
        }
        return null;
    }
}
